package com.song.controller;

import com.song.myframework.annotation.MyAutowired;
import com.song.myframework.annotation.MyController;
import com.song.myframework.annotation.MyRequestMapping;
import com.song.service.UserService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author Song Yinghui
 * @date 2018/11/2
 * @Version 1.0
 */
@MyController
public class UserController {

    @MyAutowired
    private UserService userService ;

    @MyRequestMapping(value = "/index")
    public void test(HttpServletRequest req , HttpServletResponse resp , String name) throws IOException {
        String str = userService.test();
        String s = " 接收到的数据为 name=" + name+str;
        System.out.println(s);
        resp.setContentType("application/json;charset=UTF-8");
        resp.getWriter().write(s);
    }
}
